package com.services;

import com.dao.DeptDao;
import com.pojo.Dept;

import java.util.ArrayList;
import java.util.List;

public class DeptService {
    private DeptDao dd = new DeptDao();
    private Dept dept = new Dept();
    public ArrayList<Dept> queryIndex() {
        return dd.queryDept();
    }
    public ArrayList<Dept> queryIndex(int nowPage) {
        return dd.queryDept(nowPage);
    }

    public void removeDept(String id) {
        dd.delete(id);
    }

    public void addDept(Dept d) {
        dd.insert(d);
    }

    public List<Dept> editDept(String id) {
        return dd.editDept(id);
    }

    public void saveDept(String id,String name,String address) {
        dd.update(id,name,address);
    }

    public List<Dept> querySearch(String s) {
        return dd.getSearch(s);
    }

    public int getPage() {
        return dd.queryPages();
    }
}
